package com.hup.utils.commons;


/**
 * @author hugan
 * @date 2019/8/17
 */
public class ValueUtil {

    public static int min(Integer input, int min, int def) {
        if (input == null || input < min) {
            return def;
        }
        return input;
    }

    public static String text(String input, String def) {
        if (!TextUtil.isBlank(input)) {
            return def;
        }
        return input;
    }

    public static int range(Integer input, int min, int max, int def) {
        if (input == null || input < min || input > max) {
            return def;
        }
        return input;
    }
}
